<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>
<%@ page import="com.ionglobal.cms.*" %>

<%@ include file="../init_include.jsp" %>

<%
	int check_rst=Permission.accept(dbi,session,request,"sysop","tree","catid","000000100"); 	
	if (check_rst!=Permission.CHECK_RST_SUCCESS) {
		dbi.closeAll();
		if (check_rst==Permission.CHECK_RST_DENY)
			response.sendRedirect("../deny.html");
		else
			response.sendRedirect("../index.jsp");
		return;		
	}
	
	Sysop sysop=(Sysop)session.getAttribute("sysop");

	int catid=0;
	String curpath="";
	try {	
		if(request.getParameter("catid")!=null) {
			catid=Integer.parseInt(request.getParameter("catid"));		
			Category cat=new Category(dbi,catid);
			curpath=cat.getPath();
		}
			
	} catch (NumberFormatException e) {
		out.println(e);
		return ;
	}

	//dim para in here
	<insert paradim in here>
	
	if(id!=0) {
			String sql="<insert selectonesql in here>";
	    dbi.execQuery(sql);
	    if(dbi.rsNext()) {	    
				<insert getrecord in here>
			}
			dbi.rsClose();
	}
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<%=Language.getHTMLLanguageStr()%>">
<link rel="stylesheet" href="<%=Language.getCSSFile(session)%>" type="text/css">
<SCRIPT language=JavaScript1.2 src="../script/editor.js"></SCRIPT>
<script language="JavaScript1.2">
function isNumber( sValue ){
	return isMakeOf( sValue, "+-.0123456789" );
}
function isPhone( sValue ){
	return isMakeOf( sValue, "+-ext().0123456789" );
}
function isMakeOf( sValue, sElement ){
	var nIndex = 0;
	sValue = sValue.toUpperCase();
	sElement = sElement.toUpperCase();
	
	for (nIndex=0; nIndex<sValue.length; nIndex++)  
    {  
        cCheck = sValue.charAt(nIndex);
        if (sElement.indexOf( cCheck )< 0) {  
			return false;
        }  
    }
	return true;
}

function isEmail( sValue ){
	if ( (sValue.length < 5) &&(sValue.length>0))
		return false;
	else if(sValue.indexOf("@")<=0 )
		return false;
	else if(sValue.indexOf(".")<=0 )
		return false;
	else if( !isMakeOf( sValue, "abcdefghijklmnopqrstuvwxyz0123456789-_.@" ) )
		return false;
	return true;
}
 
</script>
<title></title>
</head>
<script language="javascript">
 function showPic()
 {
 		return showIonPic('cms','<%=curpath%>');
 }

 function lookPic(){
 		return lookIonPic('cms','<%=curpath%>');
 }

 function showTag()
 {
 		return showIonTag('cms');
 }

</script>  
<body>
<%=Language.getNameByCode("sys.CurrentPos","Current Position")%>:<%=Language.getNameByCode("cms.dj.title","Add or Edit")%><br> 
<hr>   
 <table width="100%" border="0" cellspacing="1" cellpadding="2" class="input_title">
   <tr>
     <td>&nbsp;<%=Language.getNameByCode("cms.dj.title","Add or Edit")%></td>
   </tr>
 </table>
	 <form method="post" name="formIon" action="tablename_addmod.jsp">
   <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#666666">
		<insert form in here>
 </table>
 <input type="submit" name="submit" style="width=80" value="<%=Language.getNameByCode("sys.Submit","Submit")%>">
 <input type="reset" name="rest" style="width=80" value="<%=Language.getNameByCode("sys.Reset","Reset")%>">
 <input type="button" name="close" style="width=80" value="<%=Language.getNameByCode("sys.Close","Close")%> " onClick="self.close();">
 <input type="hidden" name="id" value="<%=id %>">
 <input type="hidden" name="catid" value="<%=catid%>">
</form>
</body>                
</html>        
<%@ include file="../init_free.jsp" %>        
